package tron.config;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import tron.common.ApiResult;

@RestControllerAdvice
public class CommonExceptionHandler {

    /**
     * 全局异常处理
     * @param e
     * @return
     */
    @ExceptionHandler(value =Exception.class)
    public ApiResult<Object> exceptionHandler(Exception e){
        return ApiResult.fail(e.getMessage());
    }
}
